package me.haoliang

/**
  * author: planck 
  * createTime: 2016/11/3.
  */
object ImplicitScala {

  def display(input: String) = println(input)

  implicit def typeConvert(input: Boolean) = if (input) "true" else "false"


  object MyImplicitTypeConversion {
    //可以将一个或者几个implict函数写到一个object类中
    implicit def strToInt(int: Int) = int.toString
  }


  def main(args: Array[String]) {

    import me.haoliang.ImplicitScala.MyImplicitTypeConversion._
    import me.haoliang.implicitScala.StringSay._

    display(false)
    display(1)
    display("2")

    println("aaa".increment)
  }
}
